package com.sunny.shop.api.v1;

import com.sunny.shop.core.interceptors.ScopeLevel;
import com.sunny.shop.dto.VaccinationDTO;
import com.sunny.shop.dto.VaccineDTO;
import com.sunny.shop.exception.httpe.Success;
import com.sunny.shop.service.VaccinationServiceImpl;
import com.sunny.shop.service.VaccineServiceImpl;
import com.sunny.shop.vo.VaccineVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/vaccine")
public class VaccineController {
    @Autowired
    private VaccinationServiceImpl vaccinationService;
    @Autowired
    private VaccineServiceImpl vaccineService;

    @ScopeLevel()
    @GetMapping("")
    public HashMap<Long, VaccineVO> getVaccine(){
        HashMap<Long, VaccineVO> vaccine = vaccineService.getVaccine();
        return vaccine;
    }

    @ScopeLevel()
    @PutMapping("")
    public void doTag(@RequestBody VaccinationDTO vaccinationDTO){
        Integer msgCode = vaccinationService.doTag(vaccinationDTO);
        throw new Success(msgCode);
    }
}
